#include "tracking.h"

int find_memberidx(int* a, int na, vector<int> b, int* idx){
	int n = 0, size;
	map<int, int> bmap;
	
	for(int i = 0; i < b.size(); i++){
		bmap[b[i]] = i;
	}
	
	size = 0;
	for(int i = 0; i < na; i++)
	if(bmap.find(a[i]) != bmap.end())
		size++;

	for (int i = 0; i < na; i++)
	if (bmap.find(a[i]) != bmap.end()) {
		idx[n] = i;
		n++;
	}
	
	return size;
}